import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/index',
    name: '主页',
    component: () => import('@/views/index.vue'),
    children:[
      {
        path:'shop',
        name:"商品",
        component: () => import('@/components/Home/shops.vue'),
      },
      {
        path:'evaluate',
        name:"评价",
        component: () => import('@/components/Home/evaluate.vue'),
      },
      {
        path:'store',
        name:"店铺",
        component: () => import('@/components/Home/store.vue'),
      },
    ]
  },
  {
    path:"/",
    redirect:"/index"
  },
  {
    path: '/endit',
    name: "详情",
    component: () => import('@/components/Details/Commodity.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
